/*
 * @Author: your name
 * @Date: 2022-02-23 20:29:55
 * @LastEditTime: 2022-02-23 22:15:53
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /aone_flutter/lib/packages/e01/theme/customer_theme.dart
 */

import 'package:aone_common/common.dart';
import 'package:flutter/material.dart';
import 'package:prototype/theme/color_schema.dart';

class CustomTheme {
  static final ColorSchema _colorSchema = ColorSchema();

  static ColorSchema get colorSchema => _colorSchema;

  static BoxShadow boxShadowSm = const BoxShadow(
    color: Color.fromRGBO(0, 0, 0, 0.3),
    blurStyle: BlurStyle.outer,
    blurRadius: 2,
  );

  static ThemeData get darkTheme {
    return lightTheme;
  }

  static ThemeData get lightTheme {
    return ThemeData(
      colorScheme: const ColorScheme.dark().copyWith(
        brightness: Brightness.dark,
        primary: _colorSchema.primaryColor,
        onBackground: _colorSchema.fontColor,
      ),
      backgroundColor: _colorSchema.backgroundColor,
      scaffoldBackgroundColor: _colorSchema.backgroundColor,
      appBarTheme: ThemeData.dark().appBarTheme.copyWith(
            backgroundColor: _colorSchema.secondary,
          ),
      tabBarTheme: ThemeData.dark().tabBarTheme.copyWith(
            indicatorSize: TabBarIndicatorSize.tab,
            indicator: UnderlineTabIndicator(
              borderSide: BorderSide(
                color: _colorSchema.primaryColor,
                style: BorderStyle.solid,
                width: 2.5,
              ),
            ),
          ),
      bottomNavigationBarTheme: ThemeData.dark()
          .bottomNavigationBarTheme
          .copyWith(
            backgroundColor: _colorSchema.secondary,
            selectedItemColor: _colorSchema.fontColor,
            selectedLabelStyle: const TextStyle(fontWeight: FontWeight.w500),
          ),
      tooltipTheme: TooltipThemeData(
        textStyle: TextStyle(color: _colorSchema.fontColor),
        decoration: BoxDecoration(
          color: _colorSchema.tertiary,
          borderRadius: const BorderRadius.all(
            Radius.circular(6),
          ),
        ),
      ),
      drawerTheme: ThemeData.dark().drawerTheme.copyWith(
        backgroundColor: _colorSchema.tertiary,
      ),
    );
  }
}
